//
//  LSZFavoritesListManager.m
//  JKFuYinProject
//
//  Created by 九酷 on 2018/5/15.
//  Copyright © 2018年 LC. All rights reserved.
//

#import "LSZFavoritesListManager.h"

@implementation LSZFavoritesListManager
-(id)initWithFavoritesList :(NSDictionary *)dic
{
    self = [super init];
    if (self) {
        if ([[dic valueForKey:@"data"] isKindOfClass:[NSString class]]) {
            return self;
        }
        if ([[dic valueForKey:@"data"] isKindOfClass:[NSNumber class]]) {
            return self;
        }
        if (![dic valueForKey:@"data"]) {
            return self;
        }
        NSArray * arrayDataDic = dic[@"data"];
        NSMutableArray * arrayMutAdd = [[NSMutableArray alloc]init];
        for (int i = 0; i<arrayDataDic.count; i++) {
            NSDictionary * dicData = arrayDataDic[i];
            LSZFavoritesListMg * mg = [[LSZFavoritesListMg alloc]init];
            NSString * strTime = NullStringjudgment(NSStr(dicData[@"addtime"]));
            mg.addtime = [LSZSpecialPackaging GetThePreviousTime:strTime];
            mg.id_id   = NullStringjudgment(NSStr(dicData[@"id"]));
            mg.name    = NullStringjudgment(NSStr(dicData[@"name"]));
            mg.type    = NullStringjudgment(NSStr(dicData[@"type"]));
            mg.uid     = NullStringjudgment(NSStr(dicData[@"uid"]));
            mg.total   = NullStringjudgment(NSStr(dicData[@"total"]));
            mg.is_df   = NullStringjudgment(NSStr(dicData[@"is_df"]));
            if ([[dicData allKeys] containsObject:@"image"]) {
                mg.image= NullStringjudgment(NSStr(dicData[@"image"]));
            }
            [arrayMutAdd addObject:mg];
        }
        self.arrayData = arrayMutAdd;
    }
    return self;
}
@end
@implementation LSZFavoritesListMg
@end
